let mostHitsApp = new Vue({
    el: '#mostHitsApp',
    data: {
        questions: [
            {id:1, title:'第1个问题', statusText:'已解决',
                statusClass:'text-success', hits:324},
            {id:2, title:'第2个问题', statusText:'未解决',
                statusClass:'text-info', hits:465},
            {id:3, title:'第3个问题', statusText:'未回复',
                statusClass:'text-warning', hits:486},
        ]
    },
    methods:{
        lpadMostHitsList:function () {
            //alert('准备加载热点问题列表');
            $.ajax({
                url:'/portal/questions/most-hits',
                success:function (r) {
                    let list=r.data;
                    let statusTexts=['未回复','已回复','已解决']
                    let statusClass=['text-warning','text-info','text-success']
                    for (let i = 0; i < list.length; i++) {
                        list[i].statusText=statusTexts[list[i].status];
                        list[i].statusClass=statusClass[list[i].status];
                    }
                    mostHitsApp.questions=list;
                }
            });
        }
    },
    created: function () {
        this.lpadMostHitsList();
    }
})